<template>
    <div class="search">
        <div class="left">
            豆子商城
        </div>
        <div class="middle">
            <div class="img-box"><img src="./../assets/images/fdj.png" /></div>
            <div class="input-group">
                <input placeholder="话费充值" type="text" readonly/>
            </div>
        </div>
        <div class="right" @click="showShare()">
            <div class="share-btn"></div>
        </div>

        <!-- 遮罩层  -->
        <div class="mask" v-bind:class="{'maskShow':isShow}" @click="hideShare()">
            <div class="shareJ"></div>
        </div>
    </div>
</template>
<script>
    export default {
        data(){
            return {
                isShow:false
            }
        },
        methods:{
            showShare(){
                this.isShow = true;
            },
            hideShare(){
                this.isShow = false;
            }
        }
    }
</script>
<style lang="scss">
    .search {
        position: relative;
        height:1rem;
        width: 100%;
        background-color: #f56767;
        overflow: hidden;
        .maskShow {
            display: block !important;
        }
        & > div {
            height: 100%;
            float: left;
        }
        & > div.left {
            width: 1rem;
            padding: .1rem;
            word-break: break-all;
            font-size: .36rem;
            color: #fff;
            font-weight: bold;
            text-align: center;
            line-height: .4rem;
            margin-left:.1rem;
        }
        & > div.middle {
            position: relative;
            width: 5rem;
            height: .6rem;
            margin-top: .2rem;
            background: #fff;
            border-radius: .1rem;
            margin-left:.2rem;
            div.img-box {
                position: relative;
                width: .6rem;
                height: .6rem;
                img {
                    position: absolute;
                    top: .05rem;
                    left: .05rem;
                    width: .5rem;
                    height: .5rem;
                }
            }
            .input-group {
                position: absolute;
                display: inline-block;
                height: .6rem;
                width: 4.5rem;
                line-height: .6rem;
                top: 0;
                margin-left:.6rem;
                input {
                    width: 100%;
                    border: none;
                    border-radius: 0;
                    font-size: .3rem;
                    color: #333;
                    padding-left: .1rem;
                    position: absolute;
                    top: 0;
                    line-height: .6rem;
                    background: transparent;
                }
            }
        }
        & > div.right {
            padding-top: .2rem;
            margin-left: .3rem;
            .share-btn {
                background: url("./../assets/images/title-share.png") no-repeat;
                background-size:100% 100%;
                height: .6rem;
                width: .6rem;
            }
        }
        .mask {
            position: fixed;
            width: 100%;
            height: 100%;
            top: 0;
            left:0;
            background:rgba(0,0,0,.4);
            z-index:100;
            display: none;
            .shareJ {
                position: absolute;
                right: .2rem;
                top: .2rem;
                width: 1.7rem;
                height: 1.3rem;
                background: url("./../assets/images/fenxjiantou.png") no-repeat;
                background-size:100% 100%;
            }
        }
    }
</style>
